package net.nohaven.proj.javeau.fs.model;

import net.nohaven.proj.javeau.fs.exceptions.ConditionsNotMetException;
import net.nohaven.proj.javeau.fs.exceptions.EntityAlreadyPresentException;
import net.nohaven.proj.javeau.fs.exceptions.EntityNotFoundException;
import net.nohaven.proj.javeau.fs.exceptions.GenericIOException;

public interface Filesystem {
	public FSDirectory getPwd();

	public void goToRoot();

	public void mkDir(String name) throws EntityAlreadyPresentException;

	public FSFileWriter createFile(String name)
			throws EntityAlreadyPresentException, GenericIOException;

	public void cd(String path) throws EntityNotFoundException;

	public void cdUp();

	public void rename(String name, String newName)
			throws EntityNotFoundException, EntityAlreadyPresentException;

	/**
	 * Don't delete non-empty dirs.
	 */
	public void delete(String name) throws ConditionsNotMetException;

	public FSItem[] ls();

	/*
	 * Return null if nothing is found
	 */
	public FSItem get(String name);

	public void close();
}
